/*
ID:luongho3
LANG:C++
TASK:money
*/
#include <iostream>
#include <fstream>
#include <algorithm>
using namespace std;
#define MAX_V 30
#define MAX_N 10010
ifstream fin("money.in");
ofstream fout("money.out");
int N,V;
long long t[MAX_N][MAX_V];
int amount[MAX_V];
void input() {
     fin >> V >> N;
     int i;
     for (i=1;i<=V;++i) {
         fin >> amount[i];
     }     
     //sort(amount + 1, amount + V + 1);
}
int main() {
    input();
    //dynamic programming
    int i,j;
    for (i=0;i<=N;++i) {
        t[i][0] = 0;
        if (i>=amount[1] && i%amount[1]==0) {
           t[i][1] = 1;
        }
        else {
             t[i][1] = 0;
        }
    }
    for (j=1;j<=V;++j) {
        t[0][j] = 1;
    }
    for (j=2;j<=V;++j) {
        for (i=0;i<=N;++i) {
            if (i<amount[j]) {
               t[i][j] = t[i][j-1];
            }
            else {
                 t[i][j] = t[i-amount[j]][j] + t[i][j-1];
            }
        }
    }
    fout << t[N][V] <<"\n";
    return 0;   
}
